<?php
require('../database/db.php');
$mysql=new mysql();

$shopid = $_REQUEST[shopid];

if($shopid==''||$shopid==0){
	$sql = "SELECT * FROM `categroy` where cateid<>0";
	$class=$mysql->getAll($sql);
	$sql2 = "SELECT * FROM `city` where id<>0";
	$city=$mysql->getAll($sql2);
	// 查询海淘买家服务 
	$sql3 = "select * from buyer_service where type = 0";
	$htservice=$mysql->getAll($sql3);
	// 查询海淘买家服务 end

	// 查询快购买家服务
	$sql4 = "select * from buyer_service where type = 1";
	$kgservice=$mysql->getAll($sql4);
	// 查询快购买家服务 end
	
	$arr = array('code' => 100, 'tip' =>'查询成功' ,'class' =>$class,'city'=>$city,'htservice'=>$htservice,'kgservice'=>$kgservice);
}else{
	$sql = "SELECT * FROM `shop` where shopid = $shopid";
	$message = $mysql->getRow($sql);
	$sql2 = "SELECT * FROM `zifenlei` where id in (".$message[zileimu].")";
	$categroy = $mysql->getAll($sql2);
	$sql3 = "SELECT * FROM `city` where id = $message[city]";
	$city = $mysql->getRow($sql3);
	$cityname = $city[city];
	// 查询海淘买家服务 
	$sql3 = "select * from buyer_service where type = 0";
	$htservice=$mysql->getAll($sql3);
	// 查询海淘买家服务 end

	// 查询快购买家服务
	$sql4 = "select * from buyer_service where type = 1";
	$kgservice=$mysql->getAll($sql4);
	// 查询快购买家服务 end
	
	$arr = array('code' => 100, 'tip' =>'查询成功' ,'ziname' =>$categroy,'city'=>$cityname,'htservice'=>$htservice,'kgservice'=>$kgservice);
}

echo json_encode($arr);

?>